//import $http from "./request";
//import logger from '../utils/logger';
//import { loadIM } from '@/api/IM/index'
export default{
	//用户token
	token:false,
	//用户id
	userIdZz:'',
	// 初始化
	__init(){
		// 获取用户信息
		this.token = uni.getStorageSync("token");
		this.userIdZz = uni.getStorageSync('userIdZz');
	},
	clearTokenStorage(opts){
		opts == undefined ? uni.showToast({'title':'授权登录过期,请重新登录','icon':'none'}) : '';
		this.clearStorage();
		uni.redirectTo({
			url:'/pages/login/login'
		}) 
	},
	clearStorage(){
		uni.removeStorageSync('userIdZz');
		uni.removeStorageSync('token');
		uni.removeStorageSync('userSex');
		uni.removeStorageSync('roleName');
		uni.removeStorageSync('cityList');
		uni.removeStorageSync('setCity');
		this.token = false;
		this.userIdZz = '';
	}
}
